//
//  IsureTaskHud.m
//  UEAssistant
//
//  Created by mac on 2017/5/11.
//  Copyright © 2017年 youyixinxi. All rights reserved.
//

#import "IsureTaskHud.h"

@interface IsureTaskHud ()

@property (nonatomic, strong) UIView                *baseView;
@property (nonatomic, strong) UIView                *whiteView;
@property (nonatomic, strong) UIImageView           *yellowView;
@property (nonatomic, strong) UILabel               *textLabel;
@property (nonatomic, strong) UIButton              *continBut;

@end

@implementation IsureTaskHud

- (instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    if (self) {
        [self setUI];
    }
    return self;
}

- (void)setUI{
    
    _baseView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, Screen_Width - 40*Radio, Screen_Width - 40*Radio -160*Radio)];
    _baseView.backgroundColor = [UIColor clearColor];
    [self addSubview:_baseView];
    
    _yellowView = [[UIImageView alloc]initWithFrame:CGRectMake((Screen_Width-40*Radio)/2-30*Radio, 0, 60*Radio, 60*Radio)];
    _yellowView.image = [UIImage imageNamed:@"prompt"];
    [self addSubview:_yellowView];
    
    _whiteView = [[UIView alloc]initWithFrame:CGRectMake(0, 23*Radio, Screen_Width - 40*Radio, Screen_Width - 40*Radio -160*Radio)];
    _whiteView.backgroundColor = [UIColor whiteColor];
    _whiteView.layer.cornerRadius = 5;
    _whiteView.layer.masksToBounds = YES;
    [_baseView addSubview:_whiteView];
    
    _textLabel = [[UILabel alloc]initWithFrame:CGRectMake(20*Radio, _whiteView.frame.origin.x+80*Radio, Screen_Width-20*Radio*4, 30*Radio)];
    _textLabel.backgroundColor = [UIColor colorWithWhite:1 alpha:0];
    _textLabel.textColor = RGB(51, 51, 51, 1);
    _textLabel.numberOfLines = 0;
    _textLabel.font = [UIFont systemFontOfSize:FLEXIBLE(13)];
    _textLabel.textAlignment = NSTextAlignmentCenter;
    _textLabel.text = @"此为发布到平台的任务，请到网页上操作。";
    [_baseView addSubview:_textLabel];
    
    _continBut = [UIButton buttonWithType:UIButtonTypeSystem];
    _continBut.frame = CGRectMake(0, 0, 130*Radio, 45*Radio);
    _continBut.center = CGPointMake(_textLabel.center.x, _textLabel.center.y+50*Radio);
    _continBut.backgroundColor = RGB(53, 172, 223, 1);
    [_continBut setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [_continBut setTitle:@"知道了" forState:UIControlStateNormal];
    _continBut.layer.cornerRadius = 5;
    [_continBut addTarget:self action:@selector(continAssignClicked:) forControlEvents:UIControlEventTouchUpInside];
    [_baseView addSubview:_continBut];
    
}



- (void)continAssignClicked:(UIButton *)sender{
    
    if ([self.delegate respondsToSelector:@selector(IsureHudClicked:)]) {
        [self.delegate IsureHudClicked:sender];
    }
}


@end
